var mongoose = require('mongoose');

var PTSellerAccountSchema = new mongoose.Schema({

    merchantName: { type: String, required: true },
    amzSellerAccountList: [{
        storeId: {
            type: mongoose.Schema.Types.ObjectId,
            required: false
        },
        storeDetail: {
            storeName: { type: String, required: false },
            storeURL: { type: String, required: false }
        },
        amzSellerAccount: {
            sellerId: { type: String, required: false },
            marketPlaceId: { type: String, required: false }
        },
        accountType: { type: String, required: false },
        status: { type: String, required: false },
        customerSupport: {
            email: { type: String, required: false },
            phone: { type: String, required: false },
            wechat: { type: String, required: false },
        },
        paymentMethod: { type: String, required: false },
        //customerSupport: { type: String, required: false }
    }],
    businessAddress: {
        addressLine: { type: String, required: false },
        addressLine2: { type: String, required: false },
        city: { type: String, required: false },
        province: { type: String, required: false },
        postalCode: { type: String, required: false }
    },
    bbusinessContact: {
        gender: { type: String, required: false },
        name: { type: String, required: false },
        email: { type: String, required: false },
        primaryPhone: { type: String, required: false },
        secondaryPhone: { type: String, required: false }
    },
    paymentMethod: { type: String, required: false },
    authorization:
    {
        user_id: { type: mongoose.Schema.Types.ObjectId, required: false },
        userGroup: { type: String, required: false },
        authorizedStoreList: [{
            store_id: { type: mongoose.Schema.Types.ObjectId, required: false }
        }],
    }
}, {
    collection: 'ptSellerAccount',
    timestamps: true
});

mongoose.model('PTSellerAccountSchema', PTSellerAccountSchema, 'ptSellerAccount');
// define methods










